package com.atguigu.eduservice.controller;


import com.atguigu.commonutils.R;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

//@CrossOrigin
@RestController
@RequestMapping("/eduservice/user")
public class EduLoginController {

    //login
    @PostMapping("login")
    public R login(){

        Map<String, Object> map = new HashMap<>();

        map.put("token","admin");


        R<Map<String, Object>> roles = R.ok().data(map);

        return roles;


    }

    @GetMapping("info")
    public R getInfo(){
        Map<String, Object> map = new HashMap<>();

        map.put("roles","[admin]");
        map.put("name", "admin");
        map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");

        R<Map<String, Object>> roles = R.ok().data(map);

        return roles;
    }
}
